package se.slackers.sounder.sound;

public class Note {
	int note;
	int channel;
	int velocity;

	public Note(final int note, final int channel) {
		this(note, channel, 100);
	}

	public Note(final int note, final int channel, final int velocity) {
		this.note = note;
		this.channel = channel;
		this.velocity = 100;
	}

	public int note() {
		return note;
	}

	public int channel() {
		return channel;
	}

	public int velocity() {
		return velocity;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + channel;
		result = prime * result + note;
		return result;
	}

	@Override
	public boolean equals(final Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		final Note other = (Note) obj;
		if (channel != other.channel) {
			return false;
		}
		if (note != other.note) {
			return false;
		}
		return true;
	}
}
